package com.achievo.know.common;

import java.io.IOException;
import java.util.Scanner;

public class Kill {

	public static void main(String[] args) throws IOException{
		Process process = Runtime.getRuntime().exec("taskList");
		Scanner in = new Scanner(process.getInputStream());
        int count = 0;
        while (in.hasNextLine()) {
            count++;
            String temp = in.nextLine();
            //if(temp.startsWith("chrome")){
                System.out.println(temp);

            	 temp = temp.replaceAll(" ", "");
                 // 获得pid
                 //String pid = temp.substring(10, temp.indexOf("Console"));
                // Scanner in1 = new Scanner(Runtime.getRuntime().exec("TASKKILL /F /IM chrome.exe ").getInputStream());
                 //while (in1.hasNextLine()) System.out.println(in1.nextLine());
                 // dos下开cmd窗口 ntsd -c q -p PID
                 // Runtime.getRuntime().exec("ntsd -c q -p "+pid);
           // }
        }
	}
	
	public static void main1(String[] args) throws IOException{
		Runtime.getRuntime().exec("TASKKILL /F /T /IM pdf2swf.exe ");
	}
}
